home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / gcl-1.000 / gcl-1 / gcl-1.0 / dos / read.s < prev    next >
Encoding:
Text File  |  1992-09-15  |  1.0 KB  |  42 lines

  1. /* This is file READ.S */
  2. /*
  3. ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. **
  5. ** This file is distributed under the terms listed in the document
  6. ** "copying.dj", available from DJ Delorie at the address above.
  7. ** A copy of "copying.dj" should accompany this file; if not, a copy
  8. ** should be available from where this file was obtained.  This file
  9. ** may not be distributed without a verbatim copy of "copying.dj".
  10. **
  11. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. */
  14.  
  15.     .text
  16.     .globl _read
  17. _read:
  18.     pushl    %eax
  19.     movl    $0,%eax
  20.         cmp    8(%esp),%eax    /* Is it stdin */
  21.         jne    NotStdin
  22.         cmp    _interrupt_flag,%eax /* Any SIGINT Interrupt pending ? */
  23.         je    NoInterrupt
  24.         call    _sigalrm
  25. NoInterrupt:
  26. NotStdin:
  27.     popl    %eax
  28.  
  29.     pushl    %ebx
  30.     pushl    %esi
  31.     pushl    %edi
  32.     movl    16(%esp),%ebx
  33.     movl    20(%esp),%edx
  34.     movl    24(%esp),%ecx
  35.     movb    $0x3f,%ah
  36.     int    $0x21
  37.     popl    %edi
  38.     popl    %esi
  39.     popl    %ebx
  40.     jb    syscall_error
  41.     ret
  42.